package parking.service;

import parking.ParkBoy;
import parking.ParkBoyManager;
import parking.ParkLot;
import parking.entity.Car;
import parking.entity.Ticket;

/**
 * @author daiqing.chen
 */
public interface IPark {

    /**
     * 停车
     * @param car 车
     * @return  ticket
     */
    Ticket park(Car car);

    /**
     * 取车
     * @param ticket 票
     * @return car
     */
    Car take(Ticket ticket);

    /**
     * 生成报表
     *
     *//*
    default void reportGeneration(ParkBoyManager parkBoyManager){
        System.out.println("M " + parkBoyManager.getExistCar()
                + " " + parkBoyManager.getTotalSpace());
        for (ParkLot lot:parkBoyManager.getLotList()) {
            System.out.println(" P " + lot.getSpaces().size() + " " +lot.getCapacity());
        }
        for (ParkBoy boy:parkBoyManager.getBoyList()) {
            System.out.println(" B " + boy.getExistCar()
                    + " " +boy.getTotalSpace());
            for (ParkLot p:boy.getLotList()) {
                System.out.println("  P " + p.getSpaces().size() + " " + p.getCapacity());
            }
        }
    }*/

}
